﻿using Budget.Wcf.Core.Interfaces;
using Budget.Wcf.Services;
using Castle.Facilities.WcfIntegration;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;

namespace Budget.Locator.Installers
{
    public class WcfInstaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.AddFacility<WcfFacility>();
            container.Register(Component.For<IOutcomeService>().ImplementedBy<OutcomeService>().LifestylePerWcfOperation());
            container.Register(Component.For<IIncomeService>().ImplementedBy<IncomeService>().LifestylePerWcfOperation());
            container.Register(Component.For<IBalanceService>().ImplementedBy<BalanceService>().LifestylePerWcfOperation());
            container.Register(Component.For<IStatisticsService>().ImplementedBy<StatisticsService>().LifestylePerWcfOperation());
        }
    }
}